import './assets/font/iconfont.css'
import './assets/css/style.scss'
import './assets/css/ballgame.scss'
import './assets/css/football.scss'
import './assets/css/button.scss'
import './assets/css/table.scss'

import { Dialog } from 'vant'
import xHeader from './components/widgets/header'
import directives from './utils/directives'
import filters from './utils/filters'
import FastClick from 'fastclick'
import router from './router'
import store from './store'
import http from './http'
import Vue from 'vue'

Vue.prototype.$http = http
Vue.component('xHeader', xHeader)
Vue.use(Dialog)

FastClick.attach(document.body)

/*
Vue.config.errorHandler = function (err, vm, info) {
  // `info` 是 Vue 特定的错误信息，比如错误所在的生命周期钩子
  // 只在 2.2.0+ 可用
  Toast(err + info)
}
*/

// register custom directives
Object.keys(directives).forEach(d => Vue.directive(d, directives[d]))

// register custom filters
Object.keys(filters).forEach(d => Vue.filter(d, filters[d]))

new Vue({
  el: '#app',
  render: (h) => h('router-view', {attrs: {id: 'app'}}),
  router,
  store
})
